package generic.genetic;

public class EvaluationInfo implements Comparable {

	public int position;
	public float fitness;
	public float probability;
	public float cumulativeProbability;
	
	public EvaluationInfo(){
		position = 0;
		fitness = 0;
		probability = 0;
		cumulativeProbability = 0;
	}
	
	@Override
	public int compareTo(Object arg0) {
		float cmp =  ((EvaluationInfo)arg0).fitness - this.fitness;
		if (cmp < 0){
			return -1;
		} else if (cmp > 0) {
			return 1;
		} else {
			return 0;
		}
	}

	public EvaluationInfo getCopy() {
		EvaluationInfo ret = new EvaluationInfo();
		ret.position = this.position;
		ret.fitness = this.fitness;
		ret.probability = this.probability;
		ret.cumulativeProbability = this.cumulativeProbability;
		return ret;
	}
}
